﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RN.ERP.Web.PersonService;
using Telerik.Web.UI;
using Newtonsoft.Json;
using RN.ERP.Web.ModelService;

namespace RN.ERP.Web.Exam
{
    public partial class BmChangeList : BasePage
    {
        PersonServiceClient client = new PersonServiceClient();
        private string AppID
        {
            get
            {
                return HttpContext.Current.Application[ApplicationConstant.APPLICATION_ID].ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ////type=3更换人员
                hidType.Value = Request.QueryString["type"];
                ////报名主表id
                hidId.Value = Request.QueryString["id"];
            }
        }

        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            int pageCount = RadGrid1.CurrentPageIndex + 1;
            int pageSize = RadGrid1.PageSize;
            RadGrid1.AllowCustomPaging = true;
            int count = 0;
            int id = 0;
            int.TryParse(hidId.Value, out id);
            ////更换考试报名列表
            List<ExamChangeEmp> list = JsonConvert.DeserializeObject<List<ExamChangeEmp>>(client.GetBMChangeEmpList(id, AppID, pageCount, pageSize, out count));
            RadGrid1.VirtualItemCount = count;
            RadGrid1.DataSource = list;
        }
    }
}